package com.ibeeking.found.file.service.common.dos;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 操作日志基础信息类
 *
 * @author ma116
 */
@Data
@TableName("operation_log")
public class OperationLogDO implements Serializable {
    private static final long serialVersionUID = -1L;

    @TableId(type = IdType.ASSIGN_ID)
    private Long logId;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 操作
     */
    @TableField(value = "operation")
    private String operation;

    /**
     * 操作对象
     */
    @TableField(value = "operation_obj")
    private String operationObj;

    /**
     * 终端ip地址
     */
    @TableField(value = "terminal")
    private String terminal;

    /**
     * 操作结果
     */
    @TableField(value = "result")
    private String result;

    /**
     * 操作详情
     */
    @TableField(value = "detail")
    private String detail;

    /**
     * 操作源
     */
    @TableField(value = "source")
    private String source;

    /**
     * 操作时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "time")
    private LocalDateTime time;

    /**
     * 日志级别 1-正常 2-警告 3-错误
     */
    @TableField(value = "log_level")
    private Integer logLevel;

    /**
     * 平台(1-社区,2-管理端,3-网盘,4-股票)
     */
    @TableField(value = "platform")
    private Integer platform;

    /**
     * 请求uri
     */
    @TableField(value = "request_uri")
    private String requestUri;

    /**
     * 请求method
     */
    @TableField(value = "request_method")
    private String requestMethod;

}
